package com.zh.note.huawei.onehundred.合规数组;

import java.util.Arrays;
import java.util.Scanner;
import java.util.function.ToIntFunction;

/**
 * @Author: zhanghuan
 * @date: 2023/9/2 17:58
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // int n = sc.nextInt();
        // String input = sc.nextLine();
        int n = 4;
        String input = "2 7 3 0";
        int[] nums = Arrays.stream(input.split(" ")).mapToInt(new ToIntFunction<String>() {
            @Override
            public int applyAsInt(String value) {
                return Integer.parseInt(value);
            }
        }).distinct().sorted().toArray();

        String res = "0";
        for (int i = nums.length - 1; i >= 0; i--) {
            for (int j = 0; j < i; j++) {
                for (int k = 0; k < i; k++) {
                    int a = nums[i];
                    int b = nums[j];
                    int c = nums[k];
                    if (a == (b + 2 * c)) {
                        res = a + " " + b + " " + c;
                    }
                }
            }
        }
        System.out.println(res);
    }
}
